package com.ruoyi.zhhq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zhhq.mapper.ServiceorderMapper;
import com.ruoyi.zhhq.domain.Serviceorder;
import com.ruoyi.zhhq.service.IServiceorderService;

/**
 * 维修订单Service业务层处理
 * 
 * @author wlh
 * @date 2022-10-27
 */
@Service
public class ServiceorderServiceImpl implements IServiceorderService 
{
    @Autowired
    private ServiceorderMapper serviceorderMapper;

    /**
     * 查询维修订单
     * 
     * @param orderId 维修订单主键
     * @return 维修订单
     */
    @Override
    public Serviceorder selectServiceorderByOrderId(String orderId)
    {
        return serviceorderMapper.selectServiceorderByOrderId(orderId);
    }

    /**
     * 查询维修订单列表
     * 
     * @param serviceorder 维修订单
     * @return 维修订单
     */
    @Override
    public List<Serviceorder> selectServiceorderList(Serviceorder serviceorder)
    {
        return serviceorderMapper.selectServiceorderList(serviceorder);
    }

    /**
     * 新增维修订单
     * 
     * @param serviceorder 维修订单
     * @return 结果
     */
    @Override
    public int insertServiceorder(Serviceorder serviceorder)
    {
        serviceorder.setCreateTime(DateUtils.getNowDate());
        return serviceorderMapper.insertServiceorder(serviceorder);
    }

    /**
     * 修改维修订单
     * 
     * @param serviceorder 维修订单
     * @return 结果
     */
    @Override
    public int updateServiceorder(Serviceorder serviceorder)
    {
        serviceorder.setUpdateTime(DateUtils.getNowDate());
        return serviceorderMapper.updateServiceorder(serviceorder);
    }

    /**
     * 批量删除维修订单
     * 
     * @param orderIds 需要删除的维修订单主键
     * @return 结果
     */
    @Override
    public int deleteServiceorderByOrderIds(String[] orderIds)
    {
        return serviceorderMapper.deleteServiceorderByOrderIds(orderIds);
    }

    /**
     * 删除维修订单信息
     * 
     * @param orderId 维修订单主键
     * @return 结果
     */
    @Override
    public int deleteServiceorderByOrderId(String orderId)
    {
        return serviceorderMapper.deleteServiceorderByOrderId(orderId);
    }
}
